<?php
/**
 * @author Nguyễn Sơn Tùng <sontung.x305@gmail.com> <Y!M: terminator_nst> <Skype : joker.x305>
 * @version: 1.0
 * @copyright fteam.vn
 * Date: 06/11/2012
 * Time: 11:15
 */
$browser = Yii::app()->browser;
$current_user = getSession('current_user');
/*
    Where the scripts registered using registerCoreScript or registerPackage will be inserted in the page
    CClientScript::POS_HEAD : the script is inserted in the head section right before the title element.
    CClientScript::POS_BEGIN : the script is inserted at the beginning of the body section.
    CClientScript::POS_END : the script is inserted at the end of the body section.
*/
$assets = 'backend.themes.'.Yii::app()->theme->name.'.assets';
if(YII_DEBUG)
    $baseUrl=Yii::app()->assetManager->publish(Yii::getPathOfAlias($assets), false, -1, true);
else
    $baseUrl=Yii::app()->assetManager->publish(Yii::getPathOfAlias($assets), false, -1, false);
cs()->registerMetaTag('text/html; charset=utf-8',null,'Content-Type');
cs()->registerCssFile($baseUrl.'/css/icons.css');
cs()->registerCssFile($baseUrl.'/plugins/qtip/jquery.qtip.css');
cs()->registerCssFile($baseUrl.'/plugins/uniform/uniform.default.css');
cs()->registerCssFile($baseUrl.'/css/main.css');
cs()->registerCssFile($baseUrl.'/css/custom.css');
cs()->registerCoreScript('jquery');
//cs()->registerScriptFile($baseUrl.'/js/jquery.cookie.js',CClientScript::POS_END);
cs()->registerScriptFile($baseUrl.'/plugins/qtip/jquery.qtip.min.js',CClientScript::POS_END); // Jquery Tooltip
cs()->registerScriptFile($baseUrl.'/plugins/elastic/jquery.elastic.js',CClientScript::POS_END);
cs()->registerScriptFile($baseUrl.'/plugins/uniform/jquery.uniform.js',CClientScript::POS_END);
cs()->registerScriptFile($baseUrl.'/plugins/bootbox/bootbox.min.js',CClientScript::POS_END);
cs()->registerCoreScript('jquery.ui');
if($browser->getBrowser() == Browser::BROWSER_IE && $browser->getVersion() < 9) {
    cs()->registerCssFile($baseUrl.'/css/ie.css');
    cs()->registerScriptFile($baseUrl.'/js/html5.js',CClientScript::POS_HEAD);
}
cs()->registerScriptFile($baseUrl.'/js/main.js',CClientScript::POS_END);
$translate=Yii::app()->translate;
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    <!-- Mobile Specific Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- Le styles -->
    <!-- Use new way for google web fonts
    http://www.smashingmagazine.com/2012/07/11/avoiding-faux-weights-styles-google-web-fonts -->
    <!-- Headings -->
    <!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css' />  -->
    <!-- Text -->
    <!-- <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css' /> -->
    <!--[if lt IE 9]>
    <?php
    if($browser->getBrowser() == Browser::BROWSER_IE && $browser->getVersion() < 9) {
    ?>
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:400" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:700" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Droid+Sans:400" rel="stylesheet" type="text/css" />
    <link href="http://fonts.googleapis.com/css?family=Droid+Sans:700" rel="stylesheet" type="text/css" />
    <?php
    }
    ?>
    <![endif]-->

    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le fav and touch icons -->
    <link rel="shortcut icon" href="images/favicon.ico" />
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="images/apple-touch-icon-144-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="images/apple-touch-icon-114-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="images/apple-touch-icon-72-precomposed.png" />
    <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon-57-precomposed.png" />
</head>
<script type="text/javascript">
    //adding load class to body and hide page
    document.documentElement.className += 'loadstate';
</script>
<body>
<!-- loading animation -->
<div id="qLoverlay"></div>
<div id="qLbar"></div>

<?php
 $this->renderPartial('backend.themes.fcms.views.layouts.header',array('translate'=>$translate,'current_user'=>$current_user));
?>

<div id="wrapper">

<!--Responsive navigation button-->
<div class="resBtn">
    <a href="#"><span class="icon16 minia-icon-list-3"></span></a>
</div>

<!--Sidebar collapse button-->
<div class="collapseBtn leftbar">
    <a href="#" class="tipR" title="Hide sidebar"><span class="icon12 minia-icon-layout"></span></a>
</div>

<!--Sidebar background-->
<div id="sidebarbg"></div>
<!--Sidebar content-->
<div id="sidebar">
    <div class="shortcuts shortcutsLang">
        <ul>
            <li><?php echo $translate->dropdown(); ?></li>
        </ul>
    </div><!-- End search -->
    <div class="shortcuts">
        <ul>
            <li><a href="#" title="Support section" class="tip"><span class="icon24 wpzoom-support"></span></a></li>
            <li><a href="#" title="Database backup" class="tip"><span class="icon24 icomoon-icon-database"></span></a></li>
            <li><a href="#" title="Sales statistics" class="tip"><span class="icon24 iconic-icon-chart"></span></a></li>
            <li><a href="#" title="Write post" class="tip"><span class="icon24 icomoon-icon-pencil"></span></a></li>
        </ul>
    </div><!-- End search -->

    <?php $this->widget('backend.widgets.sidebarNav.sidebarNavWidget'); ?>

    <div class="sidebar-widget">
        <h5 class="title">Monthly Bandwidth Transfer</h5>
        <div class="content">
            <span class="icon16 iconic-icon-transfer left"></span>
            <div class="progress progress-mini progress-danger left tip" title="87%">
                <div class="bar" style="width: 87%;"></div>
            </div>
            <span class="percent">87%</span>
            <div class="stat">19419.94 / 12000 MB</div>
        </div>

    </div><!-- End .sidenav-widget -->

    <div class="sidebar-widget">
        <h5 class="title">Disk Space Usage</h5>
        <div class="content">
            <span class="icon16 icomoon-icon-cloud left"></span>
            <div class="progress progress-mini progress-success left tip" title="16%">
                <div class="bar" style="width: 16%;"></div>
            </div>
            <span class="percent">16%</span>
            <div class="stat">304.44 / 8000 MB</div>
        </div>

    </div><!-- End .sidenav-widget -->

    <div class="sidebar-widget">
        <h5 class="title">Ad sense stats</h5>
        <div class="content">

            <div class="stats">
                <div class="item">
                    <div class="head clearfix">
                        <div class="txt">Advert View</div>
                    </div>
                    <span class="icon16 icomoon-icon-eye left"></span>
                    <div class="number">21,501</div>
                    <div class="change">
                        <span class="icon24 icomoon-icon-arrow-up green"></span>
                        5%
                    </div>
                    <span id="stat1" class="spark"></span>
                </div>
                <div class="item">
                    <div class="head clearfix">
                        <div class="txt">Clicks</div>
                    </div>
                    <span class="icon16 entypo-icon-thumbs-up left"></span>
                    <div class="number">308</div>
                    <div class="change">
                        <span class="icon24 icomoon-icon-arrow-down red"></span>
                        8%
                    </div>
                    <span id="stat2" class="spark"></span>
                </div>
                <div class="item">
                    <div class="head clearfix">
                        <div class="txt">Page CTR</div>
                    </div>
                    <span class="icon16 icomoon-icon-heart left"></span>
                    <div class="number">4%</div>
                    <div class="change">
                        <span class="icon24 icomoon-icon-arrow-down red"></span>
                        1%
                    </div>
                    <span id="stat3" class="spark"></span>
                </div>
                <div class="item">
                    <div class="head clearfix">
                        <div class="txt">Earn money</div>
                    </div>
                    <span class="icon16 icomoon-icon-calculate left"></span>
                    <div class="number">$376</div>
                    <div class="change">
                        <span class="icon24 icomoon-icon-arrow-up green"></span>
                        26%
                    </div>
                    <span id="stat4" class="spark"></span>
                </div>
            </div>

        </div>

    </div><!-- End .sidenav-widget -->

    <div class="sidebar-widget">
        <h5 class="title">Right now</h5>
        <div class="content">
            <div class="rightnow">
                <ul class="unstyled">
                    <li><span class="number">34</span><span class="icon16 icomoon-icon-new"></span>Posts</li>
                    <li><span class="number">7</span><span class="icon16 icomoon-icon-paper"></span>Pages</li>
                    <li><span class="number">14</span><span class="icon16 brocco-icon-list"></span>Categories</li>
                    <li><span class="number">201</span><span class="icon16 icomoon-icon-tag"></span>Tags</li>
                </ul>
            </div>
        </div>

    </div><!-- End .sidenav-widget -->

</div><!-- End #sidebar -->

<!--Body content-->
<div id="content" class="clearfix">
    <?php
    $this->widget('backend.widgets.breadcrumbs.breadcrumbsWidget',array('breadcrumb'=>$this->breadcrumbs));
    if(isset($this->menu) && count($this->menu) > 0) {
    ?>
    <div class="menu-in-content">
    <?php
        $this->widget('backend.widgets.menu.FMenu', array(
            'activateItemsOuter'=>false,
            'activateItems' => true,
            'activeCssClass'=>'btn-primary',
            'items'=>$this->menu,
            'htmlOptions'=>array('class'=>'clearfix'),
        ));
    ?>
    </div>
    <?php
    }
    ?>
    <div class="fix-float-left">
        <?php
        $flashs = user()->getFlashes(false);
        foreach($flashs as $key => $val) {
        $this->widget('bootstrap.widgets.TbAlert', array(
            'block'=>true, // display a larger alert block?
            'fade'=>true, // use transitions?
            'closeText'=>'×', // close link text - if set to false, no close link is displayed
            'alerts'=>array( // configurations per alert type
                $key=>array('block'=>true, 'fade'=>true), // success, info, warning, error or danger
            ),
        ));
        }
        ?>
    </div>
    <?php
    echo $content;
    ?>
</div><!-- End #content -->
</div><!-- End #wrapper -->
</body>
</html>
